A conventional displacement sensor includes a light projecting unit including a light emitting element such as a laser diode and a light receiving unit including a light receiving element such as a PSD, a CCD, and a CMOS, and repeatedly performs processing for emitting light to an object to be detected from the light projecting unit and receiving reflected light from the object to be detected (this process being referred to as “detection processing” herein) and processing for measuring a displacement of the object by using light receiving amount data generated by the light receiving unit. Triangulation which uses a position in a light receiving element on which reflected light is incident is often adopted as a measurement method. However, in addition thereto, a TOF (Time of Flight) method which uses a length of time from light projection to light reception, a phase difference ranging method which makes use of a phase difference between the projected light and the received reflected light, a PN code ranging method in which light subjected to intensity modulation with a PN code is projected and measurement using a result of correlation operation between that light and reflected light is conducted, and the like are available.
In addition, some conventional displacement sensors, being provided in a path where an object to be detected moves, have a function to adjust detection sensitivity in accordance with a state of reception of reflected light while it repeats detection processing and measurement processing. Patent Literature 1 (PTL 1) is exemplified as a literature showing that conventional example.
In the displacement sensor described in PTL 1, a laser diode is introduced as a light emitting element and a CCD is introduced as a light receiving element. An image signal output from the CCD is processed by an amplifier circuit or an AD conversion circuit and used for measurement processing.
This PTL 1 describes adjustment of a parameter (gain of the amplifier circuit, a time period and intensity of light emission from the laser diode, a shutter time of the CCD) for determining sensitivity for detection processing based on a calculated ratio between a peak value of a light receiving amount that appeared in an image (specifically, an average value of maximum values of density along horizontal lines) and an optimal value for that peak value.
In addition, according to the description in PTL 1, in the case where the peak value of the light receiving amount in the image has reached a saturation level, the peak value is estimated by calculation and a ratio of an optimal value for the peak value to an estimated value of the peak value is used to perform sensitivity adjustment processing, and in the case where the peak value is insufficient, sensitivity is reset to an initial state.